import { request } from 'umi';
// import defaultSettings from '../../config/defaultSettings';

console.log(process.env);
export interface LoginParamsType {
  username: string;
  password: string;
  mobile: string;
  captcha: string;
  type: string;
}

export async function fakeAccountLogin(params: LoginParamsType) {
  // return request<API.LoginStateType>(`${defaultSettings.userConfig.baseUrl}/login/account`, {
  return request<API.LoginStateType>('/login/account', {
    method: 'POST',
    data: params,
  });
}

export async function getFakeCaptcha(mobile: string) {
  return request(`/login/captcha?mobile=${mobile}`);
}

export async function outLogin() {
  return request('/login/outLogin');
}
